<template>
  <div style="width: 100%;height: 100%;">
    <table cellpadding="0" cellspacing="0" style="width: 100%;height: 100%">
      <tr>
        <td v-for="item in sizes" :key="'scaleX'+item" :class="item === 1 ? 'bothBorder':'rightBorder'">
          <div style="height: 50%; position: relative">
            <div class="ruler-value">{{Math.round(item * step)}}</div>
          </div>
          <div style="width: 100%;height: 50%;">
            <table cellpadding="0" cellspacing="0" style="width: 100%;height: 100%;">
              <tr>
                <td class="rightBorder"/>
                <td class="rightBorder"/>
                <td class="rightBorder"/>
                <td class="rightBorder"/>
                <td style="border-right: 1px solid transparent"/>
              </tr>
            </table>
          </div>
        </td>
      </tr>
    </table>
  </div>

</template>

<script>
export default {
  name: "ScaleMarkX",
  props: {
    max: {
      type: Number,
      default: 1920
    }
  },
  data() {
    return {
      sizes: 24
    }
  },
  computed: {
    step() {
      return this.max / this.sizes
    }
  }
}
</script>

<style scoped>
/*.rightBorder{border-right: 1px solid #aaa;}*/
/*.bothBorder{border-left: 1px solid #aaa;border-right: 1px solid #aaa;}*/
.bothBorder, .rightBorder {
  border-right: 1px solid #6e7ea6
}
.bothBorder {
  border-left: 1px solid #6e7ea6
}
.ruler-value {
  position: absolute;
  right: 0px;
  color: rgb(221, 221, 221);
  font-size: 13px;
  top: -10px;
  transform: scale(0.6);
  transform-origin: 90% 100%;
}
</style>
